package com.eden.controller;


import com.eden.common.ErrorCode;
import com.eden.common.R;
import com.eden.entity.SysUser;
import com.eden.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

//哈哈，那个，还是login，但前端不是合在一个请求里
//乱？乱就对了，乱说明我已经是可以上岗的软件开发程序员了
@RestController
@RequestMapping("/users")
public class UserController {
    @Autowired
    private SysUserService sysUserService;

    @GetMapping("/currentUser")
    public R currentUser(@RequestHeader("Authorization") String token){

        return sysUserService.findUserByToken(token);

    }
}
